<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\search\PointChargeSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '积分充值';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="point-charge-index">
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            'id',
            [

                'attribute'=>'uid',
                'format'=>'raw',
                'value'=>function($model){
                    return $model->user->showAvatar().'<br/>'.$model->user->nickname;
                }
            ],
            [

                'attribute'=>'type',
                'filter'=>\app\models\PointCharge::$type_arr,
//                'format'=>'raw',
                'value'=>function($model){
                    return $model->showType();
                }
            ],
            [

                'attribute'=>'pay_fee',
//                'format'=>'raw',
                'value'=>function($model){
                    return sprintf('%.2f',$model->pay_fee/100).'元';
                }
            ],
            'point',
            [

                'attribute'=>'ctime',
//                'format'=>'raw',
                'value'=>function($model){
                    return date("Y-m-d H:i:s",$model->ctime);
                }
            ],
        ],
    ]); ?>


</div>
